<!--********************************************************************
* Copyright© 2000 - 2020 SuperMap Software Co.Ltd. All rights reserved.
*********************************************************************-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
		<script src="jquery-3.2.1.js" type="text/javascript" charset="utf-8"></script>
		<script src="../../map/static/js/lib/lodash.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			window.$Config = {
				mapConfig: {
					useMask: '0',
					
				},
					}
		</script>
    <title>地图常用方法</title>
    <style>
        *{
            padding: 0;
            margin: 0;
        }
				.btns {
				    position: absolute;
				    left: 10px;
				    top: 10px;
				    z-index: 10;
				}
    </style>
</head>
<body>
	<div class="btns">
	<button type="button" onclick="wsm()">点击移动轨迹</button>
	</div>
    <iframe src="../../map/indexTalks.html?name=澄江街道" frameborder="0" style="width: 100vw;height: 100vh;"></iframe>
</body>
<script type="text/javascript">
	
   var mapWindow, lwmap, mapApp;
   window.mapLoaded = function (w, m, a) {
       mapWindow = w;
       lwmap = m;
       mapApp = a;
   
	
   // wsm()
  
	 };
	 function wsm(){
		 var path=[[120.2493576,31.90071489],[120.2476802,31.90035592],[120.2465710,31.90012023],[120.2454832,31.89990068],[120.2449099,31.89977752],[120.2443312,31.89967582]];//轨迹
		 lwmap.addMarker('start', `../../map/static/imgs/cluster/red.png`, path[0], [44, 64], [22, 32], '',
		 	{ lwType: 'activity', zIndex: 300}
		 );
		 // 终点
		 lwmap.addMarker('end', `../../map/static/imgs/cluster/green.png`, path[path.length - 1], [44, 64], [22, 32], '',
		 	{ lwType: 'activity', zIndex: 300}
		 );
		 // 移动点
		 lwmap.addMarker('ren', `../../map/static/imgs/map/zhifa.png`, path[0], [30, 35], [15,35], '',
		 	{ lwType: 'activity', zIndex: 300}
		 );
		 // 把线标上去
		  
		 lwmap.addRoutePath('route', path, 'red', 2);
		 
		 lwmap.setCenterAndZoom(path[0], 16);
	  lwmap.letMarkerMoveAlongPath('ren', _.clone(path), 500, () => {
	  	// alert('跑完了');
	  });
	  }
</script>
</html>
